package org.example.niceoil.controller;

import org.example.niceoil.dao.CustomerDao;
import org.example.niceoil.entity.ViewRecord;
import org.example.niceoil.mapper.CustomerMapper;
import org.example.niceoil.mapper.AllprocMapper;
import org.example.niceoil.mapper.RecordMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.example.niceoil.mapper.ViewRecordMapper;
import java.util.List;
@RequestMapping("/select")
@RestController
public class SelectController {
    private CustomerMapper CustomerMapper;
    private RecordMapper RecordMapper;
    private ViewRecordMapper ViewRecordMapper;
    private AllprocMapper AllprocMapper;
    @Autowired
    public SelectController(AllprocMapper AllprocMapper,RecordMapper RecordMapper,CustomerMapper CustomerMapper,ViewRecordMapper ViewRecordMapper){
        this.CustomerMapper=CustomerMapper;
        this.RecordMapper=RecordMapper;
        this.ViewRecordMapper=ViewRecordMapper;
        this.AllprocMapper=AllprocMapper;
    }

    @GetMapping("/record")
    public List<ViewRecord> record(){
        return ViewRecordMapper.selectList(null);
    }
    @GetMapping("/allproc")
    public String getall(){
        String re=AllprocMapper.getDailyOrderStats();
        return re;
    }

}
